import type { DynamicProps } from '/#/utils';
import type { BasicTableProps, BasicColumn } from '/@/components/Table/src/types/table';
import { FormProps } from '/@/components/Table';
import { searchSchemas } from './searchData';
import { IotConfigModel } from '/@/extendModel/gatewayModel';
import { getAgreementListByPage } from '/@/api/sys/agreement';
type Props = Partial<DynamicProps<BasicTableProps>>;
// 列配置
const tableColumns: BasicColumn[] = [
  {
    title: '配置名称',
    dataIndex: 'name',
    fixed: 'left',
    width: 200,
  },
  {
    title: '配置名称',
    dataIndex: 'type',
    fixed: 'left',
    width: 200,
  },
  {
    title: '地址',
    dataIndex: 'host',
    fixed: 'left',
    width: 200,
  },
  {
    title: '端口号',
    dataIndex: 'port',
    fixed: 'left',
    width: 200,
  },
];

export const formConfig: Partial<FormProps> = {
  labelWidth: 100,
  schemas: searchSchemas,
  actionColOptions: {
    span: 8,
    style: { textAlign: 'left', marginLeft: '40px' },
  },
};

export const tableConfig: Props = {
  api: getAgreementListByPage,
  columns: tableColumns,
  useSearchForm: true,
  formConfig: formConfig,
  showTableSetting: true,
  tableSetting: { fullScreen: true },
  showIndexColumn: true,
  rowKey: 'id',
  bordered: true,
  actionColumn: {
    width: 150,
    title: '操作',
    slots: { customRender: 'action' },
  },
};


export function handleDelete(rowData: [IotConfigModel]) {
  
}
